flag = False

N = 5

for i in range(N):
    x = int(input())
    flag = (x%10==0
    or flag)

print(flag)
